

typedef union
{
    struct
    {
        unsigned char    year;       // BCD codification for year, 00-99
        unsigned char    rsvd;       // reserved for future use
        unsigned char    mday;       // BCD codification for day of the month, 01-31
        unsigned char    mon;        // BCD codification for month, 01-12
        unsigned char    hour;       // BCD codification for hours, 00-24
        unsigned char    wday;       // BCD codification for day of the week, 00-06
        unsigned char    sec;        // BCD codification for seconds, 00-59
        unsigned char    min;        // BCD codification for minutes, 00-59
    }f;                     // field access
    unsigned char        b[8];       // BYTE access
    unsigned short      w[4];       // 16 bits access
    unsigned long      l[2];       // 32 bits access
}rtccTimeDate2;

int InitSD(void);
void ShutDown_SD (void);
char * GetChronoFiles(unsigned char Mode,unsigned char FullName);
unsigned char GetBestChronoInFile(char * FileName,unsigned short * BestChronoTable);
unsigned char GetChronoInFile(char * FileName,unsigned short (* ChronoTable)[7],unsigned char index, unsigned char * NbLaps);

int SaveSession (unsigned char l_uc_CurrentLap,unsigned short l_us_CurrentChrono[MAX_LAPS][MAX_SECTORS],unsigned short l_us_BestRealChrono[3]);
void ChronoToString(short chrono, char * buffer);

void writeTest(void);

